<template>
	<view>
		<view v-for="(item,index) in dataList" @tap="goInfo(item.id)" :key="index" style="margin:30rpx;background-color:white;border-radius:20rpx;padding:20rpx;
		display:flex;justify-content: space-between;">
			<view style="display: flex;justify-content:flex-start">
				<image style="width:120rpx;border-radius:50%;height: 120rpx;"
					:src="item.avatar" mode="aspectFill"></image>
				<view style="padding:10rpx 20rpx;display:flex;flex-direction: column;
				justify-content: space-around;">
					<view class="u-font-18" style="font-family:'黑体';">{{item.name}}</view>
					<view class="u-font-12" style="color:#555;">已服务：{{item.num}}单</view>
				</view>

			</view>
			<view style="display:flex;align-items: center;">
				<view class="u-m-r-10 u-m-t-5">
					<image style="width: 30rpx;height: 30rpx;" src="../../static/qieTu/daohang.png"></image>
				</view>
				<text class="u-font-12" style="font-family:'微软雅黑';font-weight: 600;">距离：{{item.params.juLi}}</text>
			</view>
		</view>
		<view v-if="dataList==0" class="cflex-r-c" style="width:100%;height:600rpx;">
			<u-empty  text="暂无我的关注" mode="favor"></u-empty>
		</view>
		
		


	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList:[],
				location:{},//用户地址信息
			}
		},
		onShow() {
			
		},
		onLoad(options) {
			this.guanZhu();
		},
		computed: {

		},
		methods: {
			myGetStorage(mykey){//获得用户地址经纬度
				return new Promise((resole,reject)=>{
					uni.getStorage({
						key: mykey,
						success: function (res) {
							resole(res.data);
						},fail:function(err){
							 //console.log(err)
						}
					})
				})
			},
			async guanZhu(){
				let lat=await this.myGetStorage("lat")||null;
				let lng=await this.myGetStorage("lng")||null;
				 //console.log(this.location)
				this.$request("kehu/other/like",{lat,lng}).then(res=>{
					 //console.log(res);
					this.dataList = res.data;
					 //console.log("====",this.dataList.length);
				})
			},
			goInfo(id){
				uni.navigateTo({
					url:'../jishi/jishi_info?id='+id
				})
			}
		}
	}
</script>

<style>

</style>
